package it.unibo.refolding.pico.mfp;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

class BinHeader {
  final short checksum; // Checksum over this header and the wave header.
  final int wfmSize;
  final int noteSize; // The size of the note text.

  BinHeader(short checksum, int wfmSize, int noteSize) {
    this.checksum = checksum;
    this.wfmSize = wfmSize;
    this.noteSize = noteSize;
  }

  static int byteCount() {
    return 4 * 2 + 2;
  }

  @Override
  public String toString() {
    return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
  }

  @Override
  public boolean equals(Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj);
  }
}
